﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <!-- Focus Visual -->

    <Style x:Key="ButtonFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border>
                        <Rectangle Margin="2" StrokeThickness="1" Stroke="#60000000" StrokeDashArray="1 2"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Fill Brushes -->

    <LinearGradientBrush x:Key="NormalBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FFF" Offset="0.0"/>
                <GradientStop Color="#CCC" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="headerBarBG" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FF284292"/>
        <GradientStop Color="#FF2175B8" Offset="0.26499998569488525"/>
    </LinearGradientBrush>
    
    <LinearGradientBrush x:Key="HorizontalNormalBrush" StartPoint="0,0" EndPoint="1,0">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FFF" Offset="0.0"/>
                <GradientStop Color="#CCC" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="LightBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FFF" Offset="0.0"/>
                <GradientStop Color="#444" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="HorizontalLightBrush" StartPoint="0,0" EndPoint="1,0">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FFF" Offset="0.0"/>
                <GradientStop Color="#EEE" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="DarkBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FFF" Offset="0.0"/>
                <GradientStop Color="#AAA" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="PressedBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#BBB" Offset="0.0"/>
                <GradientStop Color="#EEE" Offset="0.1"/>
                <GradientStop Color="#EEE" Offset="0.9"/>
                <GradientStop Color="#FFF" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <SolidColorBrush x:Key="DisabledForegroundBrush" Color="#888" />
    <SolidColorBrush x:Key="DisabledBackgroundBrush" Color="#EEE" />
    <SolidColorBrush x:Key="WindowBackgroundBrush" Color="#FFF" />
    <SolidColorBrush x:Key="SelectedBackgroundBrush" Color="#CCC" />

    <!-- Border Brushes -->

    <LinearGradientBrush x:Key="NormalBorderBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#CCC" Offset="0.0"/>
                <GradientStop Color="#444" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="HorizontalNormalBorderBrush" StartPoint="0,0" EndPoint="1,0">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#CCC" Offset="0.0"/>
                <GradientStop Color="#444" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="DefaultedBorderBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#777" Offset="0.0"/>
                <GradientStop Color="#000" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="PressedBorderBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#444" Offset="0.0"/>
                <GradientStop Color="#888" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <SolidColorBrush x:Key="DisabledBorderBrush" Color="#AAA" />
    <SolidColorBrush x:Key="SolidBorderBrush" Color="#888" />
    <SolidColorBrush x:Key="LightBorderBrush" Color="#AAA" />

    <!-- Miscellaneous Brushes -->

    <SolidColorBrush x:Key="GlyphBrush" Color="#444" />
    <SolidColorBrush x:Key="LightColorBrush" Color="#DDD" />


    <!-- Button -->

    <Style TargetType="{x:Type Button}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
        <Setter Property="MinHeight" Value="23"/>
        <Setter Property="MinWidth" Value="75"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border 
            x:Name="Border"  
            CornerRadius="2" 
            BorderThickness="1"
            Background="{StaticResource NormalBrush}"
            BorderBrush="{StaticResource NormalBorderBrush}">
                        <ContentPresenter 
              Margin="2"
              HorizontalAlignment="Center"
              VerticalAlignment="Center"
              RecognizesAccessKey="True"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="true">
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DefaultedBorderBrush}" />
                        </Trigger>
                        <Trigger Property="IsDefaulted" Value="true">
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DefaultedBorderBrush}" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource DarkBrush}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource PressedBrush}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource PressedBorderBrush}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <!-- TextBox -->

    <Style x:Key="{x:Type TextBox}" TargetType="{x:Type TextBoxBase}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="MinWidth" Value="120"/>
        <Setter Property="MinHeight" Value="20"/>
        <Setter Property="AllowDrop" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBoxBase}">
                    <Border 
            Name="Border"
            CornerRadius="0" 
            Padding="2"
            Background="LightGray"
            BorderBrush="{StaticResource SolidBorderBrush}"
            BorderThickness="1" >
                        <ScrollViewer Margin="0" x:Name="PART_ContentHost"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}"/>
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}"/>
                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- RichTextBox -->

    <Style x:Key="{x:Type RichTextBox}"
       BasedOn="{StaticResource {x:Type TextBox}}"
       TargetType="{x:Type RichTextBox}">
        <Style.Resources>
            <Style x:Key="{x:Type FlowDocument}"
           TargetType="{x:Type FlowDocument}">
                <Setter Property="OverridesDefaultStyle"
            Value="true"/>
            </Style>
        </Style.Resources>
    </Style>

    <!-- PasswordBox -->

    <Style x:Key="{x:Type PasswordBox}" TargetType="{x:Type PasswordBox}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="FontFamily" Value="Verdana"/>
        <Setter Property="PasswordChar" Value="●"/>
        <Setter Property="MinWidth" Value="120"/>
        <Setter Property="MinHeight" Value="20"/>
        <Setter Property="AllowDrop" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type PasswordBox}">
                    <Border 
            Name="Border"
            CornerRadius="0" 
            Padding="2" 
            Background="{StaticResource DisabledBackgroundBrush}"
            BorderBrush="{StaticResource SolidBorderBrush}"
            BorderThickness="1" >
                        <ScrollViewer x:Name="PART_ContentHost" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}"/>
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}"/>
                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- TabControl -->

    <Style  TargetType="{x:Type TabControl}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabControl}">
                    <Grid KeyboardNavigation.TabNavigation="Local">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Border 
              Name="Border" 
              Grid.Row="1" 
              Background="{StaticResource WindowBackgroundBrush}" 
              BorderBrush="{StaticResource SolidBorderBrush}" 
              BorderThickness="1" 
              CornerRadius="2" 
              KeyboardNavigation.TabNavigation="Local"
              KeyboardNavigation.DirectionalNavigation="Contained"
              KeyboardNavigation.TabIndex="2" >
                            <ContentPresenter 
                Name="PART_SelectedContentHost"
                Margin="4"
                ContentSource="SelectedContent" />
                        </Border>
                        <TabPanel 
              Name="HeaderPanel"
              Grid.Row="0"
              Margin="1,0,0,-1" 
              IsItemsHost="True"
              KeyboardNavigation.TabIndex="1"
              Background="Transparent" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- TabItem -->

    <Style TargetType="{x:Type TabItem}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabItem}">
                    <Grid>
                        <Border 
            Name="Border"
            Margin="-1,0,0,0" 
            Background="{StaticResource LightBrush}"
            BorderBrush="{StaticResource SolidBorderBrush}" 
            BorderThickness="1,1,1,1" 
            CornerRadius="2,12,0,0" >
                            <ContentPresenter x:Name="ContentSite"
              VerticalAlignment="Center"
              HorizontalAlignment="Center"
              ContentSource="Header"
              Margin="12,2,12,2"
              RecognizesAccessKey="True"/>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource WindowBackgroundBrush}" />
                            <Setter TargetName="Border" Property="BorderThickness" Value="1,1,1,0" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- SideBar Styles -->

    <Style x:Key="TextBlockSectionTitle" TargetType="TextBlock">
        <Setter Property="FontFamily" Value="Trebuchet MS"/>
        <Setter Property="FontSize" Value="11" />
        <Setter Property="FontWeight" Value="Normal" />
        <Setter Property="Foreground" Value="#FF1B75BB" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="TextWrapping" Value="Wrap" />
        <Setter Property="TextAlignment" Value="Left" />
        <Setter Property="Margin" Value="0,0,0,12" />
    </Style>

    <!-- Shell Boxes -->
    <Style x:Key="ShelBoxStyle" TargetType="Border">
        <Setter Property="Background" Value="#99FFFFFF" />
        <Setter Property="Opacity" Value="0.8" />
        <Setter Property="CornerRadius" Value="12,12,12,12" />
        <Setter Property="VerticalAlignment" Value="Stretch" />
    </Style>

    <!-- ListView -->

    <Style x:Key="{x:Static GridView.GridViewScrollViewerStyleKey}" TargetType="{x:Type ScrollViewer}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ScrollViewer}">
                    <Grid Background="{TemplateBinding Background}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>

                        <DockPanel Margin="{TemplateBinding Padding}">
                            <ScrollViewer DockPanel.Dock="Top"
              HorizontalScrollBarVisibility="Hidden"
              VerticalScrollBarVisibility="Hidden"
              Focusable="false">
                                <Border CornerRadius="4" Background="{StaticResource DefaultedBorderBrush}" Padding="4" Margin="0,4,0,4">
                                    <GridViewHeaderRowPresenter Margin="2,0,2,0"
                Columns="{Binding Path=TemplatedParent.View.Columns,RelativeSource={RelativeSource TemplatedParent}}"
                ColumnHeaderContainerStyle="{Binding Path=TemplatedParent.View.ColumnHeaderContainerStyle,RelativeSource={RelativeSource TemplatedParent}}"
                ColumnHeaderTemplate="{Binding Path=TemplatedParent.View.ColumnHeaderTemplate,RelativeSource={RelativeSource TemplatedParent}}"
                ColumnHeaderTemplateSelector="{Binding Path=TemplatedParent.View.ColumnHeaderTemplateSelector,RelativeSource={RelativeSource TemplatedParent}}"
                AllowsColumnReorder="{Binding Path=TemplatedParent.View.AllowsColumnReorder,RelativeSource={RelativeSource TemplatedParent}}"
                ColumnHeaderContextMenu="{Binding Path=TemplatedParent.View.ColumnHeaderContextMenu,RelativeSource={RelativeSource TemplatedParent}}"
                ColumnHeaderToolTip="{Binding Path=TemplatedParent.View.ColumnHeaderToolTip,RelativeSource={RelativeSource TemplatedParent}}"
                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                                </Border>

                            </ScrollViewer>

                            <ScrollContentPresenter Name="PART_ScrollContentPresenter"
              KeyboardNavigation.DirectionalNavigation="Local"/>
                        </DockPanel>

                        <ScrollBar Name="PART_HorizontalScrollBar"
            Orientation="Horizontal"
            Grid.Row="1"
            Maximum="{TemplateBinding ScrollableWidth}"
            ViewportSize="{TemplateBinding ViewportWidth}"
            Value="{TemplateBinding HorizontalOffset}"
            Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"/>

                        <ScrollBar Name="PART_VerticalScrollBar"
            Grid.Column="1"
            Maximum="{TemplateBinding ScrollableHeight}"
            ViewportSize="{TemplateBinding ViewportHeight}"
            Value="{TemplateBinding VerticalOffset}"
            Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"/>

                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="GridViewColumnHeaderGripper" TargetType="{x:Type Thumb}">
        <Setter Property="Width" Value="18"/>
        <Setter Property="Background" Value="#404040"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border Padding="{TemplateBinding Padding}" Background="Transparent">
                        <Rectangle HorizontalAlignment="Center" Width="1" Fill="{TemplateBinding Background}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="{x:Type GridViewColumnHeader}" TargetType="{x:Type GridViewColumnHeader}">
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Foreground" Value="#ffffff"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
                    <Grid>
                        <Border Name="HeaderBorder" BorderThickness="0,1,0,1" BorderBrush="{x:Null}" Background="{x:Null}" Padding="2,0,2,0">
                            <ContentPresenter Name="HeaderContent" Margin="0,0,0,1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                        </Border>
                        <Thumb x:Name="PART_HeaderGripper" HorizontalAlignment="Right" Margin="0,0,-9,0" Style="{StaticResource GridViewColumnHeaderGripper}" Foreground="#FFFFFFFF" Background="{x:Null}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Background" TargetName="PART_HeaderGripper" Value="{x:Null}"/>
                            <Setter Property="Foreground" TargetName="PART_HeaderGripper" Value="#FFFCFCFC"/>
                            <Setter Property="Background" TargetName="HeaderBorder" Value="{x:Null}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="HeaderContent" Property="Margin" Value="1,1,0,0"/>
                            <Setter Property="Foreground" TargetName="PART_HeaderGripper" Value="#FFE0E0E0"/>
                            <Setter Property="Background" TargetName="PART_HeaderGripper" Value="{x:Null}"/>
                            <Setter Property="Background" TargetName="HeaderBorder" Value="{x:Null}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                            <Setter Property="Background" TargetName="PART_HeaderGripper" Value="{x:Null}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="Role" Value="Floating">
                <Setter Property="Opacity" Value="0.7"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
                            <Canvas Name="PART_FloatingHeaderCanvas">
                                <Rectangle Fill="#60000000" Width="{TemplateBinding ActualWidth}" Height="{TemplateBinding ActualHeight}"/>
                            </Canvas>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="Foreground" Value="#FFFFFFFF"/>
                <Setter Property="Background" Value="{x:Null}"/>
            </Trigger>
            <Trigger Property="Role" Value="Padding">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
                            <Border Name="HeaderBorder" BorderThickness="0,1,0,1" BorderBrush="#404040" Background="{x:Null}"/>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="Foreground" Value="#FFFFFFFF"/>
                <Setter Property="Background" Value="{x:Null}"/>
                <Setter Property="BorderBrush" Value="{x:Null}"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="{x:Type ListView}" TargetType="{x:Type ListView}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListView}">
                    <Border Name="Border"  BorderThickness="1" BorderBrush="{x:Null}" Background="{x:Null}">
                        <ScrollViewer Style="{DynamicResource {x:Static GridView.GridViewScrollViewerStyleKey}}" Foreground="#FFFFFFFF">
                            <ItemsPresenter />
                        </ScrollViewer>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsGrouping" Value="true">
                            <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Border" Property="Background" Value="#AAAAAA"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="{x:Type ListViewItem}" TargetType="{x:Type ListViewItem}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Foreground" Value="#000000"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBoxItem}">
                    <Border Name="Border" Padding="2" SnapsToDevicePixels="true"  CornerRadius="4" Margin="0,4,0,0">
                        <GridViewRowPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="ItemsControl.AlternationIndex" Value="1">
                            <Setter Property="Background" TargetName="Border"  Value="#A5FFFFFF"></Setter>
                        </Trigger>
                        <Trigger Property="ItemsControl.AlternationIndex" Value="2">
                            <Setter Property="Background" TargetName="Border"  Value="Transparent"></Setter>
                        </Trigger>
                        <Trigger Property="IsSelected" Value="true">
                            <Setter Property="Background" TargetName="Border" Value="#99B4C6"/>
                            <Setter Property="Foreground" Value="#000000"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Background" TargetName="Border" Value="#c5d7e5"/>
                            <Setter Property="Foreground" Value="#000000"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="#000000"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- ComboBox -->

    <ControlTemplate x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="20" />
            </Grid.ColumnDefinitions>
            <Border
        x:Name="Border" 
        Grid.ColumnSpan="2"
        CornerRadius="0,0,0,0"
        Background="{DynamicResource SelectedBackgroundBrush}"
        BorderBrush="{DynamicResource DisabledForegroundBrush}"
        BorderThickness="1" />
            <Border 
        Grid.Column="0"
        CornerRadius="0,0,0,0" 
        Margin="1" 
        Background="{DynamicResource SelectedBackgroundBrush}" 
        BorderBrush="{DynamicResource DisabledBorderBrush}"
        BorderThickness="0,0,1,0" />
            <Path 
        x:Name="Arrow"
        Grid.Column="1"     
        Fill="{StaticResource GlyphBrush}"
        HorizontalAlignment="Center"
        VerticalAlignment="Center"
        Data="M 0 0 L 4 4 L 8 0 Z"/>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="ToggleButton.IsMouseOver" Value="true">
                <Setter Property="Background" TargetName="Border" Value="{DynamicResource SolidBorderBrush}"/>
            </Trigger>
            <Trigger Property="ToggleButton.IsChecked" Value="true">
                <Setter Property="Background" TargetName="Border" Value="{DynamicResource PressedBrush}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
                <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                <Setter TargetName="Arrow" Property="Fill" Value="{StaticResource DisabledForegroundBrush}" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <ControlTemplate x:Key="ComboBoxTextBox" TargetType="{x:Type TextBox}">
        <Border x:Name="PART_ContentHost" Focusable="False" Background="{TemplateBinding Background}" />
    </ControlTemplate>

    <Style x:Key="{x:Type ComboBox}" TargetType="{x:Type ComboBox}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
        <Setter Property="MinWidth" Value="120"/>
        <Setter Property="MinHeight" Value="20"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ComboBox}">
                    <Grid>
                        <Grid.Background>
                            <DrawingBrush Viewbox="0,0,20,20" ViewboxUnits="Absolute">
                                <DrawingBrush.Drawing>
                                    <DrawingGroup>
                                        <GeometryDrawing Brush="#FFD3D3D3">
                                            <GeometryDrawing.Geometry>
                                                <RectangleGeometry Rect="0,0,20,20"/>
                                            </GeometryDrawing.Geometry>
                                        </GeometryDrawing>
                                        <GeometryDrawing Brush="#FF000000">
                                            <GeometryDrawing.Geometry>
                                                <EllipseGeometry Center="0,0" RadiusX="10" RadiusY="10"/>
                                            </GeometryDrawing.Geometry>
                                        </GeometryDrawing>
                                        <GeometryDrawing Brush="#FF000000">
                                            <GeometryDrawing.Geometry>
                                                <EllipseGeometry Center="20,20" RadiusX="10" RadiusY="10"/>
                                            </GeometryDrawing.Geometry>
                                        </GeometryDrawing>
                                        <GeometryDrawing Brush="#FFFFFFFF">
                                            <GeometryDrawing.Geometry>
                                                <EllipseGeometry Center="20,0" RadiusX="10" RadiusY="10"/>
                                            </GeometryDrawing.Geometry>
                                        </GeometryDrawing>
                                        <GeometryDrawing Brush="#FFFFFFFF">
                                            <GeometryDrawing.Geometry>
                                                <EllipseGeometry Center="0,20" RadiusX="10" RadiusY="10"/>
                                            </GeometryDrawing.Geometry>
                                        </GeometryDrawing>
                                    </DrawingGroup>
                                </DrawingBrush.Drawing>
                            </DrawingBrush>
                        </Grid.Background>
                        <ToggleButton 
              Name="ToggleButton" 
              Template="{StaticResource ComboBoxToggleButton}" 
              Grid.Column="2" 
              Focusable="false"
              IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
              ClickMode="Press">
                        </ToggleButton>
                        <ContentPresenter
              Name="ContentSite"
              IsHitTestVisible="False" 
              Content="{TemplateBinding SelectionBoxItem}"
              ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
              ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
              Margin="3,3,23,3"
              VerticalAlignment="Center"
              HorizontalAlignment="Left" />
                        <TextBox x:Name="PART_EditableTextBox"
              Style="{x:Null}" 
              Template="{StaticResource ComboBoxTextBox}" 
              HorizontalAlignment="Left" 
              VerticalAlignment="Center" 
              Margin="3,3,23,3"
              Focusable="True" 
              Background="Transparent"
              Visibility="Hidden"
              IsReadOnly="{TemplateBinding IsReadOnly}"/>
                        <Popup 
              Name="Popup"
              Placement="Bottom"
              IsOpen="{TemplateBinding IsDropDownOpen}"
              AllowsTransparency="True" 
              Focusable="False"
              PopupAnimation="Slide">
                            <Grid 
                Name="DropDown"
                SnapsToDevicePixels="True"                
                MinWidth="{TemplateBinding ActualWidth}"
                MaxHeight="{TemplateBinding MaxDropDownHeight}">
                                <Border 
                  x:Name="DropDownBorder"
                  BorderThickness="1"
                  BorderBrush="{StaticResource SolidBorderBrush}" Background="{DynamicResource SelectedBackgroundBrush}"/>
                                <ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True">
                                    <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
                                </ScrollViewer>
                            </Grid>
                        </Popup>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasItems" Value="false">
                            <Setter TargetName="DropDownBorder" Property="MinHeight" Value="95"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                        </Trigger>
                        <Trigger Property="IsGrouping" Value="true">
                            <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                        </Trigger>
                        <Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="true">
                            <Setter TargetName="DropDownBorder" Property="CornerRadius" Value="0"/>
                            <Setter TargetName="DropDownBorder" Property="Margin" Value="0,2,0,0"/>
                        </Trigger>
                        <Trigger Property="IsEditable"
                 Value="true">
                            <Setter Property="IsTabStop" Value="false"/>
                            <Setter TargetName="PART_EditableTextBox" Property="Visibility"	Value="Visible"/>
                            <Setter TargetName="ContentSite" Property="Visibility" Value="Hidden"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
        </Style.Triggers>
    </Style>

    <!-- ComboBoxItem -->

    <Style x:Key="{x:Type ComboBoxItem}" TargetType="{x:Type ComboBoxItem}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ComboBoxItem}">
                    <Border 
            Name="Border"
            Padding="2"
            SnapsToDevicePixels="true">
                        <ContentPresenter />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsHighlighted" Value="true">
                            <Setter Property="Background" TargetName="Border" Value="#FFC5D7E5"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Expander -->

    <ControlTemplate x:Key="ExpanderToggleButton" TargetType="{x:Type ToggleButton}">
        <Border
      Name="Border" 
      CornerRadius="0,0,0,0"
      Background="{x:Null}"
      BorderBrush="{x:Null}"
      BorderThickness="0,0,1,0">
            <Path 
        Name="Arrow"
        Fill="#FF4682B4"
        HorizontalAlignment="Center"
        VerticalAlignment="Center"
        Data="M 0 0 L 4 4 L 8 0 Z"/>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="ToggleButton.IsMouseOver" Value="true">
                <Setter Property="Background" TargetName="Border" Value="{x:Null}"/>
                <Setter Property="Fill" TargetName="Arrow" Value="#FF060606"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
                <Setter Property="Background" TargetName="Border" Value="{x:Null}"/>
                <Setter Property="Fill" TargetName="Arrow" Value="#FF093E6A"/>
            </Trigger>
            <Trigger Property="IsChecked" Value="true">
                <Setter TargetName="Arrow" Property="Data" Value="M 0 4 L 4 0 L 8 4 Z" />
                <Setter Property="Fill" TargetName="Arrow" Value="#FF093E6A"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                <Setter TargetName="Arrow" Property="Fill" Value="{StaticResource DisabledForegroundBrush}" />
                <Setter Property="Background" TargetName="Border" Value="{x:Null}"/>
                <Setter Property="BorderBrush" TargetName="Border" Value="{x:Null}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style TargetType="{x:Type Expander}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Expander}">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Name="ContentRow" Height="0"/>
                        </Grid.RowDefinitions>
                        <Border 
              Name="Border" 
              Grid.Row="0" 
              Background="{x:Null}"
              BorderBrush="{x:Null}"
              BorderThickness="1" 
              CornerRadius="0,0,0,0" >
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="20" />
                                    <ColumnDefinition Width="*" />
                                </Grid.ColumnDefinitions>
                                <ToggleButton
                  IsChecked="{Binding Path=IsExpanded,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
                  OverridesDefaultStyle="True" 
                  Template="{StaticResource ExpanderToggleButton}" 
                  Background="#FF4682B4" />
                                <ContentPresenter 
                  Grid.Column="1"
                  Margin="4" 
                  ContentSource="Header" 
                  RecognizesAccessKey="True" />
                            </Grid>
                        </Border>
                        <Border 
              Name="Content" 
              Grid.Row="1" 
              Background="{x:Null}"
              BorderBrush="{x:Null}" 
              BorderThickness="1,0,1,1" 
              CornerRadius="0,0,2,2" >
                            <ContentPresenter Margin="4" />
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsExpanded" Value="True">
                            <Setter TargetName="ContentRow" Property="Height" Value="{Binding ElementName=Content,Path=DesiredHeight}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                            <Setter Property="Background" TargetName="Border" Value="{DynamicResource DisabledBorderBrush}"/>
                            <Setter Property="BorderBrush" TargetName="Border" Value="{DynamicResource DisabledForegroundBrush}"/>
                        </Trigger>

                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Focus Visual -->

    <Style x:Key="RadioButtonFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border>
                        <Rectangle 
              Margin="15,0,0,0"
              StrokeThickness="1"
              Stroke="#60000000"
              StrokeDashArray="1 2"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- RadioButton -->

    <Style x:Key="{x:Type RadioButton}" TargetType="{x:Type RadioButton}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="FocusVisualStyle"	Value="{StaticResource RadioButtonFocusVisual}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RadioButton}">
                    <BulletDecorator Background="Transparent">
                        <BulletDecorator.Bullet>
                            <Grid Width="13" 
                Height="13" >
                                <Ellipse x:Name="Border"  
                  Fill="{StaticResource NormalBrush}"
                  StrokeThickness="1"
                  Stroke="{StaticResource NormalBorderBrush}" />
                                <Path Height="8" x:Name="CheckMark" Width="8" Opacity="1" Fill="{StaticResource GlyphBrush}"
				   Stretch="Fill" 
				   Data="M102.03442,598.79645 L105.22962,597.78918 L106.78825,600.42358 C106.78825,600.42358 108.51028,595.74304 110.21724,593.60419 C112.00967,591.35822 114.89314,591.42316 114.89314,591.42316 C114.89314,591.42316 112.67844,593.42645 111.93174,594.44464 C110.7449,596.06293 107.15683,604.13837 107.15683,604.13837 z" 
				   Canvas.ZIndex="1"/>
                            </Grid>
                        </BulletDecorator.Bullet>
                        <ContentPresenter 
              Margin="4,0,0,0"
              VerticalAlignment="Center"
              HorizontalAlignment="Left"
              RecognizesAccessKey="True"/>
                    </BulletDecorator>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="false">
                            <Setter TargetName="CheckMark" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Fill" Value="{StaticResource DarkBrush}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Border" Property="Fill" Value="{StaticResource PressedBrush}" />
                            <Setter TargetName="Border" Property="Stroke" Value="{StaticResource GlyphBrush}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Border" Property="Fill" Value="{StaticResource DisabledBackgroundBrush}" />
                            <Setter TargetName="Border" Property="Stroke" Value="#40000000" />
                            <Setter Property="Foreground" Value="#80000000"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Custom TextBox -->

    <Style x:Key="CustomTextBoxStyle" TargetType="{x:Type TextBoxBase}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Foreground" Value="#ffffff"/>
        <Setter Property="MinWidth" Value="120"/>
        <Setter Property="MinHeight" Value="30"/>
        <Setter Property="AllowDrop" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBoxBase}">
                    <Border 
            Name="Border"
            CornerRadius="12" 
            Padding="5"
            Background="Transparent"
            BorderBrush="#ffffff"
            BorderThickness="1" >
                        <ScrollViewer Margin="0" x:Name="PART_ContentHost"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Border" Property="Background" Value="Transparent"/>
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}"/>
                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Popup TextBox -->

    <Style x:Key="PopupTextBoxStyle" TargetType="TextBoxBase">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Foreground" Value="#FF000000"/>
        <Setter Property="MinWidth" Value="120"/>
        <Setter Property="MinHeight" Value="30"/>
        <Setter Property="AllowDrop" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBoxBase}">
                    <Border 
                        Name="Border"
                        CornerRadius="2" 
                        Padding="5"
                        Background="Transparent"
                        BorderBrush="Transparent"            
                        BorderThickness="1">
                        <ScrollViewer Margin="0" x:Name="PART_ContentHost"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Border" Property="Background" Value="Transparent"/>
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}"/>
                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <!-- Buy/Sell Grid buttons -->

    <ControlTemplate x:Key="AddButtonTemplate" TargetType="Button">
        <Border Width="18" Height="18" Background="#00000000" Margin="2,0,2,0">
            <Grid>
                <Path x:Name="path1" Height="16" Width="16" RenderTransformOrigin="0.5,0.5" Fill="{x:Null}" Stretch="Fill" Stroke="#FF8C8C8C" StrokeThickness="1" Data="M7.5,1.5 L10.5,1.5 L10.5,7.5 L16.5,7.5 L16.5,10.5 L10.5,10.5 L10.5,16.5 L7.5,16.5 L7.5,10.5 L1.5,10.5 L1.5,7.5 L7.5,7.5 z" Margin="1,-1,1,3">
                    <Path.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform/>
                            <SkewTransform/>
                            <RotateTransform Angle="-90"/>
                            <TranslateTransform Y="2" X="0"/>
                        </TransformGroup>
                    </Path.RenderTransform>
                </Path>
                <Path x:Name="path" Height="16" Width="16" RenderTransformOrigin="0.5,0.5" Fill="#FF032E9C" Stretch="Fill" Data="M7.5,1.5 L10.5,1.5 L10.5,7.5 L16.5,7.5 L16.5,10.5 L10.5,10.5 L10.5,16.5 L7.5,16.5 L7.5,10.5 L1.5,10.5 L1.5,7.5 L7.5,7.5 z" StrokeThickness="0" Margin="1,-1,1,3">
                    <Path.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform/>
                            <SkewTransform/>
                            <RotateTransform Angle="-90"/>
                            <TranslateTransform Y="2" X="0"/>
                        </TransformGroup>
                    </Path.RenderTransform>
                </Path>
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter TargetName="path1" Property="Visibility" Value="Collapsed" />
                <Setter TargetName="path" Property="Visibility" Value="Visible" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="False">
                <Setter TargetName="path1" Property="Visibility" Value="Visible" />
                <Setter TargetName="path" Property="Visibility" Value="Collapsed" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <ControlTemplate x:Key="RemoveXButtonTemplate" TargetType="Button">
        <Border Width="18" Height="18" Background="#00000000" Margin="2,0,2,0">
            <Grid RenderTransformOrigin="0.5,0.5">
                <Grid.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform Angle="45"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </Grid.RenderTransform>
                <Path x:Name="path1" Height="16" Width="16" RenderTransformOrigin="0.5,0.5" Fill="{x:Null}" Stretch="Fill" Stroke="#FF8C8C8C" StrokeThickness="1" Data="M7.5,1.5 L10.5,1.5 L10.5,7.5 L16.5,7.5 L16.5,10.5 L10.5,10.5 L10.5,16.5 L7.5,16.5 L7.5,10.5 L1.5,10.5 L1.5,7.5 L7.5,7.5 z" Margin="1,-1,1,3">
                    <Path.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform/>
                            <SkewTransform/>
                            <RotateTransform Angle="-90"/>
                            <TranslateTransform Y="2" X="0"/>
                        </TransformGroup>
                    </Path.RenderTransform>
                </Path>
                <Path x:Name="path" Height="16" Width="16" RenderTransformOrigin="0.5,0.5" Fill="#FFD60808" Stretch="Fill" Data="M7.5,1.5 L10.5,1.5 L10.5,7.5 L16.5,7.5 L16.5,10.5 L10.5,10.5 L10.5,16.5 L7.5,16.5 L7.5,10.5 L1.5,10.5 L1.5,7.5 L7.5,7.5 z" StrokeThickness="0" Margin="1,-1,1,3">
                    <Path.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform/>
                            <SkewTransform/>
                            <RotateTransform Angle="-90"/>
                            <TranslateTransform Y="2" X="0"/>
                        </TransformGroup>
                    </Path.RenderTransform>
                </Path>
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter TargetName="path1" Property="Visibility" Value="Collapsed" />
                <Setter TargetName="path" Property="Visibility" Value="Visible" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="False">
                <Setter TargetName="path1" Property="Visibility" Value="Visible" />
                <Setter TargetName="path" Property="Visibility" Value="Collapsed" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <ControlTemplate x:Key="RemoveButtonTemplate" TargetType="Button">
        <Border Width="18" Height="18" Background="#00000000" Margin="2,0,2,0">
            <Grid>
                <Path x:Name="path1" Height="4" Width="16" RenderTransformOrigin="0.5,0.5" Fill="{x:Null}" Stretch="Fill" Stroke="#FF8C8C8C" StrokeThickness="1" Data="M7.5,1.5 L10.5,1.5 L10.5,16.5 L7.5,16.5 z" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                <Path x:Name="path" RenderTransformOrigin="0.5,0.5" Fill="#FFD60808" Stretch="Fill" Data="M7.5,1.5 L10.5,1.5 L10.5,16.5 L7.5,16.5 z" Height="4" Width="16"/>
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter TargetName="path1" Property="Visibility" Value="Collapsed" />
                <Setter TargetName="path" Property="Visibility" Value="Visible" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="False">
                <Setter TargetName="path1" Property="Visibility" Value="Visible" />
                <Setter TargetName="path" Property="Visibility" Value="Collapsed" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <!-- Submit/Cancel buttons -->

    <LinearGradientBrush x:Key="SubmitButtonEnabledBG" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FF006C3B" Offset="0.163"/>
        <GradientStop Color="#FF00A04D" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="SubmitButtonDisabledBG" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FF6C6C6C" Offset="0.163"/>
        <GradientStop Color="#FF9F9F9F" Offset="1"/>
    </LinearGradientBrush>

    <ControlTemplate x:Key="SubmitButtonTemplate" TargetType="Button">
        <Grid Height="{TemplateBinding Height}">
            <Border Width="105" x:Name="BgEnabled" Background="#FF006C3B" BorderBrush="#FFFFFFFF" BorderThickness="2,2,1,2" CornerRadius="9,0,0,9" HorizontalAlignment="Right">
                <TextBlock x:Name="textBlock" Text="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FFFFFFFF" />
            </Border>
        </Grid>
        <ControlTemplate.Triggers>

            <Trigger Property="IsEnabled" Value="false">
                <Trigger.EnterActions>
                    <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.3" Storyboard.TargetName="textBlock" Storyboard.TargetProperty="(UIElement.Opacity)"  AutoReverse="true">
                                    <SplineDoubleKeyFrame KeyTime="00:00:00.3" Value="0" KeySpline="0.5,0,0.5,1" />
                                </DoubleAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.3" Storyboard.TargetName="BgEnabled" Storyboard.TargetProperty="(FrameworkElement.Width)"  AutoReverse="true">
                                    <SplineDoubleKeyFrame KeyTime="00:00:00.3" Value="0" KeySpline="0.5,0,0.5,1" />
                                </DoubleAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.3" Storyboard.TargetName="BgEnabled" Storyboard.TargetProperty="(UIElement.Opacity)"  AutoReverse="true">
                                    <SplineDoubleKeyFrame KeyTime="00:00:00.3" Value="0" KeySpline="0.5,0,0.5,1" />
                                </DoubleAnimationUsingKeyFrames>
                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.2" Storyboard.TargetName="BgEnabled" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)">
                                    <SplineColorKeyFrame KeyTime="00:00:00.1" Value="#FF006C3B"/>
                                    <SplineColorKeyFrame KeyTime="00:00:00.2" Value="#FF6C6C6C"/>
                                </ColorAnimationUsingKeyFrames>
                            </Storyboard>
                    </BeginStoryboard>
                </Trigger.EnterActions>
                <Trigger.ExitActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.3" Storyboard.TargetName="textBlock" Storyboard.TargetProperty="(UIElement.Opacity)"  AutoReverse="true">
                                <SplineDoubleKeyFrame KeyTime="00:00:00.3" Value="0" KeySpline="0.5,0,0.5,1" />
                            </DoubleAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.3" Storyboard.TargetName="BgEnabled" Storyboard.TargetProperty="(FrameworkElement.Width)"  AutoReverse="true">
                                <SplineDoubleKeyFrame KeyTime="00:00:00.3" Value="0" KeySpline="0.5,0,0.5,1" />
                            </DoubleAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.3" Storyboard.TargetName="BgEnabled" Storyboard.TargetProperty="(UIElement.Opacity)"  AutoReverse="true">
                                <SplineDoubleKeyFrame KeyTime="00:00:00.3" Value="0" KeySpline="0.5,0,0.5,1" />
                            </DoubleAnimationUsingKeyFrames>
                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.2" Storyboard.TargetName="BgEnabled" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)">
                                <SplineColorKeyFrame KeyTime="00:00:00.1" Value="#FF6C6C6C"/>
                                <SplineColorKeyFrame KeyTime="00:00:00.2" Value="#FF006C3B"/>
                            </ColorAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </Trigger.ExitActions>
            </Trigger>

        </ControlTemplate.Triggers>
    </ControlTemplate>

    <ControlTemplate x:Key="CancelButtonTemplate" TargetType="Button">
        <Grid Height="{TemplateBinding Height}">
            <Border Width="105" BorderBrush="#FFFFFFFF" BorderThickness="1,2,2,2" CornerRadius="0,9,9,0" Background="#FFFFFFFF">
            <TextBlock Text="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF666666"  Margin="-9,0,0,0" />
            </Border>
        </Grid>
    </ControlTemplate>

    <!-- ScrollBar -->

    <Style x:Key="ScrollBarLineButton" TargetType="{x:Type RepeatButton}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Border 
          x:Name="Border"
          Margin="1" 
          CornerRadius="2" 
          Background="{x:Null}"
          BorderBrush="{x:Null}"
          BorderThickness="1">
                        <Path 
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            Fill="#404040"
            Data="{Binding Path=Content, RelativeSource={RelativeSource TemplatedParent}}" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="#E0E0E0" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="#888888"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Border Background="Transparent" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border 
          CornerRadius="2"
          BorderThickness="1" Background="#FF121212" BorderBrush="#FFCECECE" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
        <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Width="Auto" >
            <Grid.RowDefinitions>
                <RowDefinition MaxHeight="18" Height="0.409*"/>
                <RowDefinition Height="0.182*"/>
                <RowDefinition MaxHeight="18" Height="0.409*"/>
            </Grid.RowDefinitions>
            <Border
      Grid.RowSpan="3"
      CornerRadius="2" 
      Background="#FF3B3B3B" Margin="15,22,15,22" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
            <RepeatButton 
      Grid.Row="0"                           
      Style="{StaticResource ScrollBarLineButton}"
      Height="18"
      Command="ScrollBar.LineUpCommand"
      Content="M 0 4 L 8 4 L 4 0 Z" Margin="10,0,10,0" />
            <Track 
      x:Name="PART_Track"
      Grid.Row="1"
      IsDirectionReversed="true">
                <Track.DecreaseRepeatButton>
                    <RepeatButton 
          Style="{StaticResource ScrollBarPageButton}"
          Command="ScrollBar.PageUpCommand" />
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                    <Thumb 
          Style="{StaticResource ScrollBarThumb}" 
          Margin="10,0,10,0"  
          Background="#C0C0C0"
          BorderBrush="#404040" Height="Auto" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="8" />
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                    <RepeatButton 
          Style="{StaticResource ScrollBarPageButton}"
          Command="ScrollBar.PageDownCommand" />
                </Track.IncreaseRepeatButton>
            </Track>
            <RepeatButton 
      Grid.Row="3" 
      Style="{StaticResource ScrollBarLineButton}"
      Height="18"
      Command="ScrollBar.LineDownCommand"
      Content="M 0 0 L 4 4 L 8 0 Z" Margin="10,0,10,0"/>
        </Grid>
    </ControlTemplate>

    <ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}">
        <Grid >
            <Grid.ColumnDefinitions>
                <ColumnDefinition MaxWidth="18"/>
                <ColumnDefinition Width="0.00001*"/>
                <ColumnDefinition MaxWidth="18"/>
            </Grid.ColumnDefinitions>
            <Border
      Grid.ColumnSpan="3"
      CornerRadius="2" 
      Background="#FF3B3B3B" Margin="22,15,22,15" />
            <RepeatButton 
      Grid.Column="0"                           
      Style="{StaticResource ScrollBarLineButton}"
      Width="18"
      Command="ScrollBar.LineLeftCommand"
      Content="M 4 0 L 4 8 L 0 4 Z" Margin="0,10,0,10" />
            <Track 
      x:Name="PART_Track"
      Grid.Column="1"
      IsDirectionReversed="False">
                <Track.DecreaseRepeatButton>
                    <RepeatButton 
          Style="{StaticResource ScrollBarPageButton}"
          Command="ScrollBar.PageLeftCommand" />
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                    <Thumb 
          Style="{StaticResource ScrollBarThumb}" 
          Margin="0,10,0,10"  
          Background="#C0C0C0"
          BorderBrush="#404040" Height="8" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                    <RepeatButton 
          Style="{StaticResource ScrollBarPageButton}"
          Command="ScrollBar.PageRightCommand" />
                </Track.IncreaseRepeatButton>
            </Track>
            <RepeatButton 
      Grid.Column="3" 
      Style="{StaticResource ScrollBarLineButton}"
      Width="18"
      Command="ScrollBar.LineRightCommand"
      Content="M 0 0 L 4 4 L 0 8 Z" Margin="0,10,0,10"/>
        </Grid>
    </ControlTemplate>

    <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Style.Triggers>
            <Trigger Property="Orientation" Value="Horizontal">
                <Setter Property="Width" Value="Auto"/>
                <Setter Property="Height" Value="Auto" />
                <Setter Property="Template" Value="{StaticResource HorizontalScrollBar}" />
            </Trigger>
            <Trigger Property="Orientation" Value="Vertical">
                <Setter Property="Width" Value="Auto"/>
                <Setter Property="Height" Value="Auto" />
                <Setter Property="Template" Value="{StaticResource VerticalScrollBar}" />
            </Trigger>
        </Style.Triggers>
    </Style>
</ResourceDictionary>